﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DHQGHN.DAL.Base;
using DHQGHN.DAL.Models.Admin;

namespace DHQGHN.DAL.DAO.Admin
{
    public class ActionNameDAO : SqlDAO
    {
        public const string PROCEDURE_GET_ACTION_NAME = "spGetListActionName";
        public ActionNameDAO(string connectionString, Type type= null):
            base(connectionString, type) { ;}

        public List<ActionNameModel> GetListActionName(string userName, string appId, Dictionary<string, string> mapDictionary)
        {
            try
            {
                SqlCommand cmd = this.GetSprocCommand(ActionNameDAO.PROCEDURE_GET_ACTION_NAME);
                cmd.Parameters.Add(CreateParameter("@UserName", userName));
                cmd.Parameters.Add(CreateParameter("@AppId", Convert.ToInt32(appId)));

                return GetList<ActionNameModel>(cmd, mapDictionary);
            }
            catch
            {
                throw;
            }
        }
    }
}
